home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Shareware 1997 February
/
PC Shareware 1997-02.iso
/
programy
/
envlp122
/
envelop.5
/
Tools
/
Arsenal
/
parts
/
pictclip
/
pictclip.eto
< prev
next >
Wrap
Text File
|
1996-03-15
|
6KB
|
210 lines
Type PictClipMasterForm From SampleMasterForm
Dim sbrNavigator As New ScrollBar
Dim Label1 As New Label
Dim imgCropDisplay As New Image
Dim imgFullDisplay As New Image
Dim bmpIcons As New Bitmap
Dim picOutline As New MarkupLayer
' METHODS for object: PictClipMasterForm
Sub Convert2RowColumn(x As Single, y As Single)
Dim image_width As Integer
Dim image_height As Integer
Dim row_height As Integer
Dim column_width As Integer
Dim column As Integer
Dim row As Integer
Dim row_val As Integer
Dim col_val As Integer
' We need to move the display box to the right icon location
image_width = imgFullDisplay.Width
image_height = imgFullDisplay.Height
row_height = image_height / 13
column_width = image_width / 12
column = x / column_width
row = y / row_height
' Need to convert row/column values into scrollbar values 1-156
' Debug.Print row, column
row_val = row * 12
col_val = column + 1
sbrNavigator.Value = row_val + col_val
End Sub
Sub DisplayIcon(icon_number As Integer)
Dim row As Integer
Dim column As Integer
Dim x_offset As Integer
Dim y_offset As Integer
' Used to update the display of the icon
' as well as update the location of the highlight box
Select Case icon_number
Case 1 To 12
row = 1
column = icon_number
Case 13 To 24
row = 2
column = icon_number - 12
Case 25 To 36
row = 3
column = icon_number - 24
Case 37 To 48
row = 4
column = icon_number - 36
Case 49 To 60
row = 5
column = icon_number - 48
Case 61 To 72
row = 6
column = icon_number - 60
Case 73 To 84
row = 7
column = icon_number - 72
Case 85 To 96
row = 8
column = icon_number - 84
Case 97 To 108
row = 9
column = icon_number - 96
Case 109 To 120
row = 10
column = icon_number - 108
Case 121 To 132
row = 11
column = icon_number - 120
Case 133 To 144
row = 12
column = icon_number - 132
Case 145 To 156
row = 13
column = icon_number - 144
End Select
x_offset = (column - 1) * 24
y_offset = (row - 1) * 22
imgCropDisplay.CropXOffset = x_offset
imgCropDisplay.CropYOffset = y_offset
' Move the highlight box according to the offset values
MoveDisplayBox(row, column)
imgCropDisplay.Refresh
sbrNavigator.Refresh
End Sub
Sub imgFullDisplay_MouseDown(button As Integer, shift As Integer, x As Single, y As Single)
Convert2RowColumn(x, y)
End Sub
Sub MoveDisplayBox(row As Integer, column As Integer)
Dim x_zero As Integer
Dim y_zero As Integer
Dim image_width As Integer
Dim image_height As Integer
Dim row_height As Integer
Dim column_width As Integer
' We need to move the display box to the right icon location
x_zero = imgFullDisplay.Left
y_zero = imgFullDisplay.Top
image_width = imgFullDisplay.Width
image_height = imgFullDisplay.Height
row_height = image_height / 13
column_width = image_width / 12
picOutline.Width = column_width + picOutline.BevelWidth * Screen.TwipsPerPixelX * 2
picOutline.Height = row_height + picOutline.BevelWidth * Screen.TwipsPerPixelY * 2
picOutline.Left = x_zero + ((column - 1) * column_width) - picOutline.BevelWidth * Screen.TwipsPerPixelX
picOutline.Top = y_zero + ((row - 1) * row_height) - picOutline.BevelWidth * Screen.TwipsPerPixelY
picOutline.Refresh
End Sub
Sub ResetApplication_Click()
imgCropDisplay.ScaleX = 1
imgCropDisplay.ScaleY = 1
imgCropDisplay.Refresh
End Sub
Sub sbrNavigator_Change()
DisplayIcon(sbrNavigator.Value)
End Sub
End Type
Begin Code
' Reconstruction commands for object: PictClipMasterForm
'
With PictClipMasterForm
.TextPreLoad()
.Caption := "Picture Clip Application"
.Move(4035, 1860, 5055, 6840)
.SampleDir := "C:\Envelop\arsenal\parts\pictclip\"
.SampleName := "pictclip"
With .sbrNavigator
.Caption := "sbrNavigator"
.ZOrder := 2
.Move(300, 4950, 4350, 300)
.SmallChange := 1
.LargeChange := 3
.Min := 1
.Max := 156
.Value := 1
.Orientation := "Horizontal"
.Move(300, 4950, 4350, 300)
End With 'PictClipMasterForm.sbrNavigator
With .Label1
.Caption := "Cropped Area:"
.ZOrder := 3
.Move(1500, 5595, 1410, 300)
End With 'PictClipMasterForm.Label1
With .imgCropDisplay
.Caption := "imgCropDisplay"
.ZOrder := 4
.Move(3165, 5550, 375, 345)
.BevelOuter := "None"
.AutoInitCropRect := False
.Picture := PictClipMasterForm.bmpIcons
.ResizeMode := "Clip"
.ScrollBars := "Never"
.ScaleX := 1
.ScaleY := 1
End With 'PictClipMasterForm.imgCropDisplay
With .imgFullDisplay
.Caption := "imgFullDisplay"
.ZOrder := 5
.Move(300, 315, 4350, 4365)
.BevelOuter := "None"
.Picture := PictClipMasterForm.bmpIcons
End With 'PictClipMasterForm.imgFullDisplay
With .bmpIcons
.LoadType := "MemoryBased"
.FileName := "pictclip.ero"
.ResId := 0
End With 'PictClipMasterForm.bmpIcons
With .picOutline
.Caption := "picOutline"
.ZOrder := 1
.Move(240, 255, 480, 450)
.BevelInner := "Raised"
.BevelWidth := 4
End With 'PictClipMasterForm.picOutline
With .helpfile
.FileName := "C:\Envelop\arsenal\parts\pictclip\pictclip.hlp"
End With 'PictClipMasterForm.helpfile
End With 'PictClipMasterForm
End Code